Key-value store for lightweight replication of metadata

ABSTRACT

Methods and systems are disclosed for managing replication of metadata in a master-slave database environment. While metadata is managed on a master node using database tables with transaction guarantees, metadata copies on the slave node are managed using a lightweight key-value store. In exemplary embodiments, master metadata database tables are mapped to respective key-value structures at one or more slave nodes. The key-value structures have entries pointing to respective metadata objects, which include copies of metadata items stored in the master metadata database tables. The key-value structures can be hierarchically organized under a parent key-value structure. Metadata object versions can be organized as a linked list to facilitate multi-version concurrency control. Methods are disclosed for building the key-value store, for retrieving metadata from the store, for updating the store, for providing multi-version concurrency control, and for pruning obsolete metadata versions. Variants are disclosed.

BACKGROUND

Databases are widely used in diverse fields. The scale of databasedeployments continues to increase in size, in transaction-handlingcapacity, and in geographic reach. There remains a continuing need forefficient distributed database technologies.

SUMMARY

In summary, the detailed description is directed to various innovativetechnologies for metadata management in a master-slave databaseenvironment. Examples of disclosed technologies use one or morekey-value structures to maintain and retrieve copies of metadata itemsat a slave node, while retaining a row store metadata table at themaster node. The master metadata table can be operated as a databasetable with guaranteed transactions and their attendant overhead, whileslave key-value structures can be operated in a lightweight manner,without the same overhead or guarantees.

In one aspect, the disclosed technologies are directed tocomputer-readable media storing software instructions for creating aslave key-value store with one or more key-value entries, and attachingmetadata objects to respective key-value entries. The key-value storeserves to catalog, index, or access local copies of master metadataitems. On the master node, one or more database tables store metadataassociated with a database instance on the master node. The metadata canbe associated with tables, views, users, or various constructs, modules,or features of the database instance. Local copies of some or all of themaster metadata items can be stored on a slave node. The key-value storecomprises key-value entries organized as one or more key-valuestructures. A key-value structure can include one or more key-valueentries, each having a key and a value. The value field of a key-valueentry can store a metadata object that includes a metadata item, or areference to a metadata object storing the metadata item. Alternatively,the value field of a key-value entry can store a reference to asequential data structure (e.g., linked list) that includes a version ofthe metadata object with the metadata item, and may include otherversions of the metadata object. Or, the value field can store, at leastat the time of initialization, a placeholder that will be replaced bythe metadata object or reference. The key field serves as an identifierof an associated metadata object or metadata item and can be used tolook up a desired key-value entry in a slave key-value store. The keyfield can contain a qualified name of the associated metadata item. Insome examples, key-value entries for metadata items can be created whencopying application-level database tables characterized by the metadataitems from the master node to the slave node. In other examples,key-value entries can be created when needed, for example, in responseto a request for an associated metadata item.

In examples, a metadata item can be a single or atomic element such asan integer, a floating point number, or a text string, while in otherexamples a metadata item can be a plurality of elements. In examples,one or more elements of a metadata item can describe anapplication-level database table, a table partition, a table replica, ora database view, or another feature or attribute of the databaseinstance on the master node, as described herein.

In some examples, multiple versions of a metadata object can be attachedto a single key-value entry to facilitate multi-version concurrencycontrol (MVCC). The metadata object versions can be organized as asequential data structure containing multiple metadata objects, forexample, a linked list. In such examples, the value field of a key-valueentry can contain a reference to the head of the linked list. Assuccessive versions (or snapshots) of a metadata item are received atthe slave node, they can be packaged as respective metadata objects andattached at the tail of the linked list (or, for another approach inwhich metadata object versions are ordered in descending order, at thehead of the linked list), and thereby attached to the key-value entryfor the metadata item. In addition to metadata items, a metadata objectversion can incorporate one or more timestamps indicating a timestamprange for which that metadata object version is valid. In examples,successive metadata versions are valid for successive time intervalsthat are contiguous but non-overlapping. The software instructions ofthe disclosed technology can also be used to perform some or all ofthese actions.

In some examples, multiple key-value stores can be established onrespective slave nodes of a common master node. The multiple key-valuestores can be the same or different. Metadata from a first mastermetadata database table can be stored on one slave node but not onanother slave node, or stored on both slave nodes. Two slave nodes canstore non-identical sets of metadata items from a particular metadatadatabase table.

In another aspect, the disclosed technologies are directed tocomputer-readable media storing software instructions for retrievingcopies of one or more metadata items from a key-value store on a slavenode, in response to a request for the metadata item(s). Based on therequest, a search value is formed. The search value is looked up amongkeys of the key-value store, and the matching key-value entry is used toobtain the locally stored copies of one or more of the requestedmetadata items. In some examples, a metadata object including requestedmetadata item(s) is directly stored in, and can be retrieved from, thevalue field of the matching key-value entry. In other examples, thevalue field contains a reference, such as a pointer, to a metadataobject in which one or more requested metadata items are stored. In suchexamples, the value field can be dereferenced to obtain the metadataobject, and the copy of the metadata item can be extracted from themetadata object. In further examples, the value field contains areference to a sequential data structure, such as a linked list, ofmultiple versions of metadata objects which can be organized bytimestamp. In such examples, the value field can be dereferenced toobtain the head of a sequential data structure (e.g., linked list), andthe sequential data structure can be traversed to obtain the correctversion of the metadata object having a timestamp matching the request;copies of the requested metadata item(s) can be extracted from thismetadata object. If the request timestamp is outside the timestamp rangeof a given metadata object version, then the given metadata version isnot the correct version. If the request timestamp is within the range ofa subsequent metadata object version, then the subsequent metadataobject version is the correct version.

In another aspect, the disclosed technologies are directed tocomputer-readable media storing software instructions for maintaining orpruning a sequential data structure of versions of metadata objects. Adetermination can be made whether a metadata object version is stillneeded, for example, based on the upper limit of its timestamp range.When the determination is made that the metadata object version is nolonger needed, it can be dissociated from its attached key-value entry.

In a further aspect, the disclosed technologies are directed tocomputer-readable media storing software instructions for creating andmaintaining the key-value store as a hierarchical collection ofkey-value structures. A parent key-value structure has parent key-valueentries for other key-value structures. Respective distinct childkey-value structures can be instantiated in the slave key-value storefor each metadata database table of the database instance on the masternode. The child key-value structures contain key-value entries forrespective master metadata items as described herein. Each parentkey-value entry contains a key serving as an identifier of theassociated child key-value structure, and a value which is a referenceto the associated child key-value structure.

In examples, the child key-value structure can be established along withformation of the associated master metadata database table, such as whena view is created. In other examples, the child key-value structure canbe established along with copying of a database table or other constructfrom the master node to the slave node. In further examples, the childkey-value structure can be established at the time when a metadata itemfrom the associated master metadata database table is requested at theslave node.

In another aspect, the disclosed technologies are directed tocomputer-readable media storing software instructions for retrievingcopies of metadata items from a hierarchical key-value store. Uponreceipt of a request for a metadata item from a given master metadatadatabase table, a structure search value is determined and looked up ina parent key-value structure to find a reference to the child key-valuestructure for the given master metadata database table. Based at leastpartly on the request, a metadata item search value is determined andlooked up in the child key-value structure to find the matchingkey-value entry associated with the requested metadata item. Asdescribed herein, the matching key-value entry is used to get the copyof the metadata item which, in examples, can be stored in a metadataobject within the key-value entry, or in a metadata object directlypointed to by the value field of the key-value entry, or in a metadataobject version in a sequential data structure (e.g., linked list) ofmetadata objects pointed to by the value field.

In another aspect, the disclosed technologies are directed tocomputer-readable media storing software instructions for operating onthe master metadata database tables using database transactions havingguarantees, and for using non-guaranteed operations on the slavekey-value store. In examples, the master metadata database tables canonly be operated on with guaranteed transactions. In examples,guaranteed transactions have properties of atomicity, consistency,isolation, and durability (“ACID”). In examples, a master metadatadatabase table can be an in-memory row store table managed by a databasemanagement system (“DBMS”). In contrast, in examples, key-value storeoperations are lacking in one or more of the ACID properties.

In another aspect, the disclosed technologies are directed tocomputer-readable media storing software instructions for implementingkey-value entries that are read-only. The key-value store can be managedas a read-only cache.

The innovations can be implemented as part of one or more methods, aspart of one or more computing systems adapted to perform an innovativemethod, or as part of non-transitory computer-readable media storingcomputer-executable instructions for causing a computing system toperform the innovative method(s). The various innovations can be used incombination or separately. The foregoing and other objects, features,and advantages of the invention will become more apparent from thefollowing detailed description, which proceeds with reference to theaccompanying figures.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram depicting metadata structures at a master node andat a slave node, according to disclosed technologies.

FIG. 2 is a flowchart of a method for building a slave key-value storeaccording to disclosed technologies.

FIG. 3 is a flowchart of another method for building a slave key-valuestore according to disclosed technologies.

FIG. 4 is a flowchart of a method for processing a metadata requestaccording to disclosed technologies.

FIG. 5 is a flowchart of another method for processing a metadatarequest according to disclosed technologies.

FIG. 6 is a partial flowchart depicting methods for lazy filling of akey-value store according to disclosed technologies.

FIG. 7 is a diagram depicting organization of slave metadata accordingto disclosed technologies.

FIG. 8 is a flowchart of a method for processing a metadata requestaccording to disclosed technologies.

FIGS. 9A-9F are diagrams illustrating methods of pruning an obsoletemetadata object version, according to disclosed technologies.

FIG. 10 is a flowchart of a method for updating metadata according todisclosed technologies.

FIG. 11 is a diagram schematically depicting a computing environmentsuitable for implementation of disclosed technologies.

FIG. 12 is a diagram schematically depicting computing devices operatingin conjunction with a computing cloud for implementation of disclosedtechnologies.

DETAILED DESCRIPTION Overview

Distributed databases can be implemented in various ways. For example,in SAP HANA, different tables can be assigned to different indexservers, which can be running on different hosts. Alternatively, a tablecan be split so that different rows or columns are stored on differentindex servers, or a table can be replicated on multiple index servers.The distributed deployment can have metadata for data tables, for views,and/or for other features, attributes, functions, etc. (generally,entities) of the distributed deployment. In some examples, multipleservers can store part or whole of a common table, and it can bedesirable for each such server to have its own copy or cache ofassociated metadata. In examples, a metadata manager of one server canserve as a master metadata manager, while metadata managers of otherservers can serve as slave metadata managers. Correspondingly, themaster metadata manager controls a master metadata store, while theslave metadata managers control respective slave metadata stores. Slavemetadata stores are caches that can contain clones or copies of all orpart of the master metadata store. The master and slave metadata storescan be stored alongside or within their respective servers.

In examples, the master metadata store can be implemented using one ormore row store database tables, while in other examples, the mastermetadata store can be implemented using other database tables or otherdata structures. Database tables provide master metadata with robust,pre-existing support for transactions with guarantees, for example,using read/write access including locks, change logs, maintenance,and/or concurrency controls. Guarantees can be provided in the form ofthe “ACID” properties: atomicity, consistency, isolation, anddurability. Providing these guarantees can add significant overhead inthe process of managing the database tables; at the same time, theseguarantees could also be unnecessary in a slave metadata store. Forexample, a slave metadata store can be read-only, and accordingly locksupport for the slave metadata store can be much simpler than for themaster metadata store, or even non-existent.

The disclosed technologies take advantage of the differences inrequirements for master and slave metadata stores to implement simplerstructures for slave metadata stores and thereby increase the efficiencyof slave metadata operations. Particularly, a slave metadata store canbe implemented using one or more key-value structures, which cansimplify the process of managing metadata at a slave node. Further, thekey-value structures can be simply adapted to facilitate multi-versionconcurrency control, so that out-of-order transactions can be providedwith correct metadata according to their respective timestamps.

The disclosed technologies can be extended to multiple slaves and tomultiple masters. Two slave nodes of a common master database instancecan implement respective key-value metadata stores, which can (but neednot) be identical. Particularly, a master metadata table can be cachedon one slave node but not on the other. Different sets of metadata itemsfrom a single master metadata table can be cached on the two slavenodes. In some examples, a database system can support multiple isolateddatabases which can have different masters. Thus, a server can have therole of master node for one database but have the role of slave node foranother database. In some examples, a slave node can have separatekey-value metadata stores for each isolated database, while in otherexamples, a slave node can maintain multiple isolated key-valuestructures within a single key-value store.

Definitions

As used in this description, a “table” is a two-dimensional arrayorganized into rows (records) and columns (fields). A table can be adatabase table used to store application data, or a metadata table usedto store metadata about the database environment or entities within thedatabase environment. In examples, a table can be a row store tableaccessed through an associated index structure which maps keys torespective row identifiers. The index structure can be a B+ tree such asa compressed prefix B+ tree. The table and index structure can supportconcurrent reads and writes with guarantees. Multi-version concurrencycontrol can be implemented through the use of row-level or record-levelwrite locks and optimistic read locks. Version management, rollback,replays, and disaster recovery can be supported using differential logs.The table can support a range of constraints or integrity checks.

As used in this description, a “key-value structure” is a collection ofentries (or tuples), each tuple having of one or more values associatedwith a key. In examples, a tuple has a key and a single associatedvalue, so the tuple is a 2-tuple or ordered pair which can be dubbed a“key-value pair”. Key-value structures can be used to store metadataabout a database environment, on one or more slave nodes. In someexamples, a key-value structure can be implemented using one or moreflat structures, while in other examples, the key-value structure can beimplemented using one or more hash tables. A key-value structure can beimplemented as read-only from the client side, with updates from amaster node supported by a simple tuple-level lock or in some examplesno lock at all. Multi-version concurrency control can be supportedthrough the use of organizing metadata objects into linked lists orother sequential data structures. A key-value structure for slavemetadata can be implemented without one or more of the constraints,integrity checks, or guarantees that apply for management of a mastermetadata table. Overall, a key-value metadata structure can beimplemented with considerably less overhead than a (master) metadatatable, thereby providing improved efficiency and performance with regardto time, processor utilization, and storage space.

As used in this disclosure, a “key-value store” is a collection of oneor more key-value structures together with any other structures,objects, etc. (generally, metadata objects) in which slave metadatacopies are stored. In some examples only a single key-value structure isused. Where multiple key-value structures are used, the key-valuestructures can be organized hierarchically into two or more levels, sothat a top-level (parent or root) key-value structure matches a prefixof a search key and points to a bottom-level (child or leaf) key-valuestructure, which matches the entire key and provides the desired value.In some examples, the key-value structures can be organized into twolevels, while in other examples, intermediate levels of key-valuestructures can be implemented, so that the total number of key-valuestructure levels can be three, four, five, 6-10, or more levels. Akey-value structure below the root level is pointed to by acorresponding entry in a parent key-value structure, and can match afurther portion of the search key as compared to its parent level. Akey-value entry above the leaf level provides link to a subsequentlevel. A key-value entry at the leaf level provides the target metadataitem (e.g., as part of a metadata object) or points to a metadata objectcontaining the target metadata item. In other examples, distinct keyscan be used for different levels.

A metadata item can be wrapped (or otherwise associated) with a versionnumber, one or more timestamps indicating a range of validity, and/or aname or other identifier into a metadata object. A metadata object cancontain one or more metadata items. A metadata object can be embeddedwithin the value field of a leaf-level key-value entry, or it can bepointed to by a reference in such value field. Metadata objects can bechained in a traversable sequential data structure such as a linkedlist. In such examples, the head of the sequential data structure can beattached or pointed to directly by the value field of the key-valueentry, while other metadata objects in the sequential data structure canbe reached from the head and are thus attached or pointed to indirectly.

As used in this disclosure, a “node” is a host computer with one or moreprocessors and attached memory hosting at least part of databaseinstance. The term “master node” (or “slave node”) indicates a nodeacting in the role of a master (or slave) for replication activity.

EXAMPLE Metadata Architecture

FIG. 1 is a diagram 100 depicting metadata stores at a master node andat a slave node of a database environment, according to disclosedtechnologies. In the illustration, the master node metadata store 101contains indexed database tables 111-117 (dubbed “metadata databasetables”), which can be managed as database tables with guaranteedtransactions; in examples, indexed database tables 111-117 support onlytransactions with guarantees. The slave node metadata store 102 is akey-value store containing key-value structures 130, 140, 150 along withmetadata objects 161-169, 171-178. As described herein, the key-valuestore 102 can be managed as a lightweight store with low overhead, suchas a read-only cache, and can be managed using operations lackingACID-based guarantees.

At the master node, metadata database table 111 includes an index 111 aand an underlying table 111 b; metadata database tables 112-117 aresimilar. In examples, metadata database tables 111-117 can be in-memoryrow store database tables managed by a database management system(“DBMS”) at the master node. As illustrated, metadata database table 111contains metadata for application-level database tables 121 a-k.Metadata database table 117 contains metadata for views 127 a-m.Similarly, metadata database tables 112-116 (latter not shown) cancontain metadata corresponding to other classes of objects, constructs,features, attributes, etc. (generally, entities) within the databaseinstance on the master node.

At the slave node, slave key-value store 102 contains copies of metadataitems for tables, views, and optionally other entities of the masterdatabase instance that could be required by the slave node or by clientsof the slave node. In the slave metadata store 102, metadata objects161-169 and 171-178 are attached to hierarchically arranged key-valuestructures 130, 140, 150. Root-level structure 130 comprises a set ofkey-value entries 131-137. Each entry is a 2-tuple (or key-value pair)comprising a key (131 k-137 k) and a value (131 v-137 v). Key 131 k canbe “Table” which provides a prefix match for all keys beginning with“Table,” such as “Table:User1:abc.” In the example shown, value 131 vcan be a reference, such as a pointer, to leaf-level key-value structure140, which contains all keys 141 k-149 k having a “Table” prefix. Thecorresponding values 141 v-149 v contain respective references (e.g.,pointers) to the corresponding metadata objects 161-169, each of whichcontain one or more metadata items corresponding to their associatedkeys.

Similarly, key 137 k can be “View:” which provides a prefix match forall keys beginning with “View:” such as “View:User4:bb2.” In the exampleshown, value 137 v can be a reference, such as a pointer, to leaf-levelkey-value structure 150, which contains all keys 151 k-158 k having a“View:” prefix. The corresponding values 151 v-158 v contain respectivereferences (e.g., pointers) to the corresponding metadata objects171-178, each of which contain one or more metadata items correspondingto their associated keys.

Similarly, other entries in key-value structure 130 can have keys 132 k,133 k, and so on, providing prefix match to keys having a prefix of“Synonym,” “Sequence,” and so forth, for different classes, types,categories, etc. of metadata represented in different master metadatatables. The corresponding values 132 v, 133 v, and so on can point tocorresponding leaf-level key-value structures, not shown.

With this disclosure in hand, one of ordinary skill will appreciate thatmany variations are possible within the scope of the disclosedtechnologies. Although key-value structures 130, 140, 150 are shown asseparate structures, in some examples they can be stacked together toform a single key-value structure, in which (such as value 131 v)contains a row number, pointer, or other reference to the correspondingkey-value pair (such as {141 k, 141 v}), and similarly for the othervalues 132 v-137 v. Although key-value structures 130, 140, 150 areshown as a hierarchy, this is not a requirement: in some examples, allkey entries such as “Table:User2:ghi” or “View:User3:dd” can becollected in a single key-value structure, without any of the entries ofparent key-value structure 130. Although metadata objects 161-169,171-178 are shown outside structures 140, 150, in some examples some orall of the metadata objects 161-169, 171-178 can be directly stored asthe respective values within structures 140, 150. Additionally, theslave key-value store 102 can be implemented with more levels, lesslevels, or non-uniform level depth. For example, a second-level,intermediate (non-leaf) key-value structure can be implemented in whichdifferent key-value entries correspond to different “Users” for the“Table” metadata database table. In this example, the key-value entryfor “Table:User2” can include a reference to a third-level key-valuestructure that includes key-value entries for “Table:User2:def,”“Table:User2:ghi,” and so on. Thus, different third-level key-valuestructures can be implemented for keys having prefixes “Table:User1,”“Table:User2,” and/or “Table:User20.” The key-value structure can beorganized as a tree, but need not be organized as a tree. For example,“Table:User5” and “View:User5” can resolve to a common third-levelkey-value structure containing all table and view keys for User5. Thus,key-value structures can form a graph other than a tree.

Likewise, many variations are also possible at the master metadata store101. For example, instead of being implemented as in-memory row storetables, some or all of metadata database tables 111-117 can be columnstore tables, disk tables, hybrid tables, or other data structures. Oneor more metadata database tables can be implemented without an index, orindexes can be shared between metadata database tables. Varyingcardinalities can be supported. As shown, metadata database table 111provides metadata for a plurality of application-level tables 121 a-k,but this is not a requirement: any cardinality of relationship betweenapplication-level tables and metadata tables can be implemented,including one-to-one, many-to-one, one-to-many, or many-to-manySimilarly, any cardinality between views and metadata data tables ispossible. Similarly, any cardinality between metadata database tables111-117 and rows in root key-value structure 130 (or, between metadatadatabase tables and child key-value tables) can be implemented. Forexample, application-level tables Table_A, Table_B, and Table_C can besupported by a single metadata database table 111, but can havedifferent key-value entries in root key-value structure 130. Cardinalityfrom parent-level key-value entries to child-level key-value structurescan be one-to-one or many-to-one.

First Example Method for Building a Key-Value Store

FIG. 2 is a flowchart 200 of a method for building a slave key-valuestore according to disclosed technologies. As described herein, theslave key-value store can incorporate one or more key-value structuresarranged hierarchically or otherwise in a connected graph. The slavekey-value store can also incorporate one or more metadata objectsattached to corresponding key-value entries in the key-value structuresand located in a memory pool locally at the slave node.

At process block 210, a key-value store is instantiated. At processblock 220, a trigger is received, for adding one or more metadata itemsto the key-value store. Responsive to this trigger, a new key-valueentry is formed at process block 230 and added to the key-value store atprocess block 240. A new metadata object containing one or more newlyadded metadata items is formed at process block 250. Finally, at processblock 260, the new metadata object is attached to the new key-valueentry. Alternate orderings of process blocks 230-260 can be used. Forexample, process block 250 for forming the metadata object can bepositioned before one or both of process blocks 230, 240. As anotherexample, process block 240 can be deferred until after the metadataobject has been attached to the key-value entry, which means that thekey-value entry can be left un-modified after it is written.

Returning to process block 210, instantiation of the key-value store caninclude instantiation of one or more key-value structures within thekey-value store. In some examples, the key-value store consists of asingle key-value structure with entries for all slave metadata items.This key-value structure can be instantiated as an empty structure, orit can be pre-filled with key-value entries for some known metadataitems. In other examples, the key-value store is designed as ahierarchical collection of key-value structures, which provides for moreefficient look-up as compared to a single (and potentially large)key-value structure. In some examples, hierarchical key-value structurescan distribute contention (such as lock contention) between clients orbetween a client and a master. In such examples, instantiation of thekey-value store can include creation of a parent key-value structure andoptionally one or more child key-value structures. For each childkey-value structure created, a parent key-value entry can be created inthe parent key-value structure with a reference to the associated childkey-value structure.

At process block 220, a trigger is received, for adding one or moremetadata items to the key-value store. In varying examples, differenttriggers can be used. In some examples, copying all or part of anapplication-level database table, a view, or other construct of themaster database instance onto the slave node can be used as a trigger topropagate associated metadata. In other examples, a housekeeping, user,or system event can be used as a trigger to copy new or modifiedmetadata from the master node to the slave node. In further examples, arequest for a metadata item not already present in the slave metadatastore can be used as a trigger to add that metadata item.

At process block 230, a new key-value entry is formed. The key-valueentry can include a key field which is used to identify the key-valueentry and can be searched for to find a key-value entry and metadataobject matching a particular search key. The key field can be anidentifier of the master metadata item for which the key-value entry isintended. The identifier can be a text name, and can be a qualifiedname. The key-value entry can further include a value field which isassociated with a metadata object, as described further below.

At process block 240, the new key-value entry for a new metadata item isadded to the key-value store. The new key-value entry can be added to asole key-value structure where only one key-value structure is present,or it can be added to an appropriate child key-value structure dependingon what the metadata item pertains to. For example, a view metadata itemcan be added to a child key-value structure for view metadata, such as150, and a table metadata item can be added to a child key-valuestructure for table metadata, such as 140. In some examples, the newkey-value entry can be added at the end of the key-value structure,while in other examples, the key-value structure can be maintained insorted order, and the new key-value entry can be added at its sortposition within the key-value structure. In further examples, thekey-value structure is maintained as a hash table, and adding the keyvalue entry can include computing a hash of its key to obtain a hashaddress and writing the key-value entry or a pointer to the key-valueentry at the hash address. A collision resolution mechanism can beimplemented to handle hash collisions. In examples, the key-value entrycan include additional fields, for example, a field for a timestamp atwhich the associated metadata item was updated on the master node.

At process block 250, the new metadata object is formed. In examples,forming the new metadata object includes: retrieving the desiredmetadata item from the master node, packaging the retrieved (copy ofthe) metadata item into a metadata object, and storing the metadataobject at the slave node. In various examples, the metadata object canbe identical to the retrieved metadata item, or can include additionalattributes such as one or more timestamps, size of the metadata object,a forward reference to a succeeding metadata object, or a name or otheridentifier. The metadata object can be stored in a memory pool, or in adata structure such as a linked list or an array of metadata objects.

At process block 260, the new metadata object is attached to the newkey-value entry. In examples, this is achieved by writing a pointer orother reference to the metadata object into the value field of thekey-value entry. In other examples, the value field of the addedkey-value entry can hold the copy of the metadata item itself, which ispart of the metadata object. In other examples, the value field can holdsome other type of reference (not a pointer) to the metadata object,which is a property of the metadata object, such as an address or name,that can be used to locate and retrieve the metadata object. Inexamples, where the metadata object has not yet been built or stored,the value field of the key-value field can be left blank at processblock 230, while in other examples with different ordering of processblocks, the copy of the metadata item or the metadata object's addresscan be inserted into the key-value entry at process block 230 itself.

Although FIG. 2 shows formation of a single key-value entry and attachedmetadata object at process blocks 230-260, a plurality of new key-valueentries and respective metadata objects can be added to the key-valuestore as a result of a single trigger event, or at other times duringthe lifecycle of the slave key-value store. Where multiple entries andmetadata objects are added, the same process blocks 230-260 are followedfor each entry-metadata object pair. The various entry-metadata objectpairs can be added sequentially, in parallel, in batches, or in anycombination thereof.

Second Example Method for Building a Key-Value Store

FIG. 3 is a flowchart 300 of another method for building a slavekey-value store according to disclosed technologies. While similar insome respects to flowchart 200, flowchart 300 shows certain details ofinstantiating a multi-level key-value store, and has a differentordering of operations equivalent to process blocks 230-260.

At process block 310, an empty key-value store is instantiated at aslave node. At process block 315, an empty parent key-value structure isinstantiated within the key-value store. At process block 320, an emptychild key-value structure is instantiated within the key-value store,corresponding to a given master metadata database table. In examples,each child key-value structure can cache metadata from a differentrespective master metadata database table. However, not all mastermetadata database tables need be cached on a given slave node. Atprocess block 325, a parent key-value entry is added to the parentkey-value structure with a key field identifying the child key-valuestructure or the given master metadata database table. The value of theparent key-value entry can be set to reference the child key-valuestructure.

To add a copy of a master metadata item to the slave metadata store, atprocess block 330 the metadata item copy is retrieved from the masternode and a metadata object is formed containing the copied metadataitem. At process block 335, a given key-value entry is formed, having akey representative of the metadata item. At process block 340, themetadata object is attached to the given key-value entry, for example,by setting the value field of the key-value entry to an address or otherreference of the metadata object. Then, at process block 345, the givenkey-value entry is added to the child key-value structure, as describedherein.

First Example Method for Metadata Item Retrieval

FIG. 4 is a flowchart 400 of a method for processing a metadata requestaccording to disclosed technologies. As described below, a search keycorresponding to the metadata request is determined, and used to findthe requested metadata item.

At process block 410, a request is received at a slave node for ametadata item. For purposes of illustration, this can be a metadata itemwhose copy is stored in metadata object 161 and associated with akey-value entry {141 k, 141 v}. The request can include a name of thedesired metadata item, which can be a bare name “abc” or a qualifiedname such as “Table:User1:abc” or “User1:abc.”

At process block 420, a metadata item search value is formed, based atleast partly on the request. The metadata item search value can be atext string such as a qualified name, e.g., “Table:User1:abc.” Atprocess block 430, a match for the metadata item search value is soughtamong the keys of the child key-value structure.

In some examples, a key lookup in a key-value structure can beimplemented by a serial traversal of the key-value structure, while inother examples having sorted keys, a binary search can be used. Infurther examples, a key-value structure can be implemented as a hashtable, in which case lookup can be performed by computing a hash of asearch value and using the hash as an index into the hash table.

Then, at process block 440, the value (e.g., 141 v) is retrieved fromthe matching key-value entry in the key-value structure, and used toobtain the copy of the requested metadata item from a metadata object.In examples, the retrieved value can be a direct or indirect referenceto the desired metadata object (e.g., 161) which contains the copies ofthe one or more desired metadata items. Finally, at process block 450,the copy of the desired metadata item is returned in response to theoriginal request.

Second Example Method for Metadata Item Retrieval

FIG. 5 is a flowchart 500 of a second method for processing a metadatarequest according to disclosed technologies. As described below, thismethod determines a search key corresponding to the metadata request,and uses the search key to find the requested metadata item.

At process block 510, a request is received at a slave node for ametadata item. For purposes of illustration, this can be a metadata itemwhose copy is stored in metadata object 161 and associated with akey-value entry {141 k, 141 v}. The request can include a name of thedesired metadata item, which can be a bare name “abc” or a qualifiedname such as “Table:User1:abc” or “User1:abc.” At process block 515, astructure search value is formed, based at least partly on the request.The structure search value can be, e.g., “Table” or “Table:User1:abc.”At process block 520, a prefix match for the structure search value issought in a root-level key-value structure similar to 130. In differentexamples, the match can be an exact match to, e.g., “Table” or a partialmatch to, e.g., “Table:User1:abc.” At process block 525, the value(e.g., 131 v) is obtained from the matching entry of the root key-valuestructure; this value contains or provides a reference to a childkey-value structure similar to 140.

At process block 530, a metadata item search value is formed, based atleast partly on the request. The metadata item search value can be atext string such as a qualified name, e.g., “Table:User1:abc.” Atprocess block 535, a match for the metadata item search value is soughtamong the keys of the child key-value structure. Once found, thematching key-value entry can be used to get the copy of the requestedmetadata item. At process block 540, the value (e.g., 141 v) isretrieved from the matching key-value entry in the child key-valuestructure, and used to retrieve a metadata object. In examples, theretrieved value can be the copy of the desired metadata item itself,copies of a plurality of desired metadata items, a desired metadataobject containing one or more copies of desired metadata items, or adirect or indirect reference to the desired metadata object (e.g., 161)which contains the one or more copies of desired metadata items.

Finally, at process blocks 545 and 550, the copy of the desired metadataitem is extracted from the metadata object and returned in response tothe original request. Alternatively, in some examples, the metadataobject can be returned intact in response to the request.

Example Methods for Lazy Filling of a Key-Value Store

In the description above, matching keys have been presumed to be presentat process blocks 520 and 535. In some examples, the slave key-valuestore can be managed so that the key-value store is proactively builtand maintained and matching entries are always present, except possiblyunder fault conditions. In other examples, the slave key-value store canbe built and populated on a lazy, on-demand basis, and matching entriescould be absent at the time of a metadata request.

FIG. 6 is a partial flowchart 600 depicting methods for lazy filling ofa key-value store according to disclosed technologies. Process blocks520, 535, and 550 are kept intact from FIG. 5, and additional processblocks are shown for handling the no-match conditions.

To handle examples with no-match found at process block 535, a decisionbranch can be incorporated within process block 535. If a match wasfound at process block 535, then the method continues as described toprocess block 540. Otherwise, in the no-match case, the method proceedsto process block 637, where the copy of the requested metadata item canbe retrieved from the master node. Then, at process block 639, thecorresponding metadata object can be built. At process block 641, a newkey-value entry for the requested metadata item is added to the childkey-value structure, with the metadata object being attached to the newkey-value entry, similar to the description of FIG. 2 above. Using thecopy of the retrieved metadata item in place of the extracted copy ofthe metadata item (process block 643), the method can return to processblock 550, where the copy of the metadata item is returned in responseto the request received at process block 510. In this manner, therequest for a metadata item absent from the slave key-value metadatastore results in (i) adding the copy of the requested metadata item tothe slave metadata store, and (ii) response to the request with the copyof the requested metadata item.

Similarly, in some examples, a matching entry in the parent key-valuestructure could be absent at process block 520. To handle examples withno-match found at process block 520, a decision branch can be insertedwithin process block 520. If a match was found at process block 520,then the method continues as described to process block 525. Otherwise,in the no-match case, the method proceeds to process block 622, where anew child key-value structure is created. Then, at process block 624, anew key-value entry can be added to the parent key-value structure andattached to the newly built child key-value structure. Since the newchild key-value structure can be empty at this point, a no-matchcondition can be expected at process block 535. Accordingly, the methodcan proceed directly to process block 637 for handling a missingkey-value entry as described above, bypassing process blocks 525, 530,535. In this manner, the request for a metadata item belonging to anon-existent key-value structure results in creation and attachment ofthe missing key-value structure, followed by handling of the missingmetadata item as described above.

Example Multi-Version Support

FIG. 7 is a diagram 700 depicting organization of slave metadataaccording to disclosed technologies, including multi-version support. Asdescribed herein, key-value structure 710 is a structure that can beused to match keys 711 k-719 k and determine respective values 711 v-719v. As illustrated, metadata objects 721 a-721 c form a linked list forone of the key-value entries {711 k, 711 v} of the key-value structure710. Each metadata object incorporates two timestamps, which indicate atransaction timestamp range for which the metadata object is presumed tobe valid. In this example, “Min: 100000” and “Max: 100050” in metadataobject 721 a indicate that metadata object 721 a is valid fortransaction timestamps in the range [100000, 100050), where squarebrackets [ ] denote a closed interval endpoint and parentheses ( )denote an open interval endpoint. Similarly, metadata object 721 b isvalid for transaction timestamps in the interval [100050, 100055).Finally, metadata object 721 c is valid for transaction timestamps≥100055.

These timestamps can be understood as follows. Metadata object 721 a wasoriginally tagged as valid over [100000, ∞), until a metadata update wasreceived from the master node with timestamp 100050. At this point, newmetadata object 721 b was formed with validity [100050, ∞) and chainedto previous metadata object 721 a, with metadata object 721 a having its“Max” validity tag “Max: ∞” replaced by “Max: 100050” to reflect themetadata update In this way, metadata object 721 a is retained intactfor older transactions having timestamps <100050, and new metadataobject 721 b is available for later transactions having timestamps≥100050. A similar metadata update at 100055 causes newer metadataobject 721 c to be chained to metadata object 721 b, with the “Max:” tagof metadata object 721 b being updated to 100055. In the illustrationshown, no newer metadata update has been made to the copies of metadataitem represented by metadata objects 721 a-721 c. Although new metadataobject 729 b was added with timestamp 100340, this pertains to adifferent metadata item and does not affect the chain or linked list ofmetadata objects 721 a-721 c. In examples, successive metadata objectsin a chain can have successively later ranges of timestamp validity.

Although described as a linked list, the chain 721 a-721 c can beimplemented in various ways. For example, the metadata objects 721 a-721c can be implemented as a vector or contiguously stored array, withoutsome of the overhead associated with a linked list structure. In otherexamples, metadata object 721 b can be implemented as a change or deltarelative to its preceding metadata object 721 a.

As illustrated, entry value 711 v points to the head of the chain orlinked list 721 a-721 c, which allows updates to be made withoutbreaking any links or changing the value 711 v. In other examples, thechain 721 a-721 c can be organized so that value 711 v points to thetail (most recent) metadata object, 721 c (or, alternatively, newmetadata object versions are added to the head of the list). Such anarrangement provides greater efficiency for newer requests (having newertransaction timestamps).

As illustrated, each metadata object contains two timestampsrepresenting the beginning and end of its valid timestamp range.However, this is not a requirement of the disclosed technologies. Inexamples, only the ending timestamp is included in the metadata object;the beginning timestamp can be inferred from the ending timestamp of aprevious metadata object; a beginning timestamp for the head object 721a can be superfluous, since all transactions preceding the actualbeginning timestamp value are known to have been cleared from thedatabase system. In other examples, only the beginning timestamp isincluded in the metadata object; the ending timestamp can be inferredfrom the beginning timestamp of the succeeding metadata object, and canbe taken to be ∞ (infinity) if there is no succeeding metadata object.The timestamp value(s) for a metadata object can be maintained as partof the metadata object or maintained separately outside the metadataobject. Similarly, the reference (e.g., pointer) to a next metadataobject in a chain can be maintained as part of the metadata object ormaintained separately outside the metadata object. Other attributes (notshown) such as size of a metadata object can also be maintained.

Regardless of the organization of the chain 721 a-721 c, a housekeepingoperation can purge old metadata objects when all transactions havingtimestamps below their Max tags have been completed or cleared from thedatabase environment. For example, the chain 721 a-721 c could have hadearlier metadata objects with Min tags of 050000, 063000, and so on,which were removed by a housekeeping operation at 100005. At timestamp100005, metadata objects 721 a, 722 a, and 729 a were still current, andcould not be removed, while metadata objects 721 b-721 c and 729 b hadnot yet been created. Purging of old metadata objects can happenperiodically (e.g., according to a schedule) or on demand in response toa condition (e.g., low memory).

Third Example Method for Metadata Item Retrieval

FIG. 8 is a flowchart 800 of a third method for processing a metadatarequest according to disclosed technologies. Process blocks 810-840 aresimilar to process blocks 510-540 described earlier; additionaloperations in FIG. 8 are directed to traversing a list of metadataobjects similar to 721 a-721 c to obtain the correct metadata objectbased for a timestamp of the metadata request.

At process block 810, a request is received at a slave node for ametadata item for a transaction having timestamp B. The structure searchvalue can be determined at process block 815 similar to process block515. Process blocks 820, 825, 830, 835 are similar to process blocks520, 525, 530, 535 described earlier, in which two levels of key-valuestructures are traversed to find a key-value entry whose key matches themetadata item search value.

Then, at process block 840, the value of the matching key-value entry,which can be a pointer, is followed to a metadata object (e.g., 721 a)at the head of a list of metadata objects. In some examples, the list ofmetadata objects has a single member (e.g., 722 a), while in otherexamples, the list of metadata objects can have two (e.g., 729 a-729 b),three (e.g., 721 a-721 c), or even more metadata objects. At processblock 840, a list position counter J can be set to 1, indicating thatthe method is at the head of the list of metadata objects. The metadataobjects of the list can be denoted according to link position, e.g.,O_(J); thus, the first metadata object is simply O₁. The descriptionproceeds in terms of the list position counter J for the sake ofillustration, although one of ordinary skill will appreciate that animplementation of flowchart 800 can omit the list position counter J.

The method proceeds to process block 845, where the valid time range[T1, T2) can be determined from tags associated with or incorporatedwithin metadata object O_(J). Then, at process block 850, the requesttimestamp B is compared with T1 and/or T2. If T1>B, then the methodfollows branch 1, and proceeds to report an error at process block 855.The reason for this is that the first metadata object has the lowesttimestamp range in its linked list; if B<T1, there cannot be anothermetadata object which is valid for timestamp B. Alternatively, therecould have been an earlier metadata object that was purged duringhousekeeping. This too can be reported as an error, because the earliermetadata object should not have been purged until after all transactionswith timestamp B have been completed or cleared. In some examples, T1 isalways 0 for the first metadata object, so B is never less than T1.

Examining other cases at process block 850, if B T2, then branch 2 isfollowed to process block 860. In examples, the condition B≥T2 meansthat a metadata update has occurred and that a newer metadata object ispresent. Therefore, list position counter J is incremented, and the listis followed to the next metadata object O_(J), whereupon the methodloops back to process block 845.

The remaining case at process block 850 is for T2>B T1, for which branch3 is followed to process block 890. Because timestamp B is within therange of validity for O_(J), a copy of a metadata item from the metadataobject O_(J) can be returned, in response to the metadata requestreceived at process block 810. As described herein, rather thanreturning the entire metadata object O_(J), in some examples one or moremetadata values can be extracted from the metadata object O_(J) atprocess block 890, and the extracted metadata values can be returnedinstead of the entire metadata object O_(J).

Examples of Metadata Pruning

FIGS. 9A-9F are diagrams illustrating methods of pruning an obsoletemetadata object version. Pruning can be desirable when it is determinedthat all transactions earlier than some timestamp have been completed orotherwise cleared from the database system. Pruning can be performedperiodically (e.g., according to a schedule) or on demand in response toa condition (e.g., low memory).

FIG. 9A depicts a chain of metadata objects 921 a-921 c similar to thechain of metadata objects 721 a-721 c described above. Each metadataobject 921 i (for i ∈ {a, b, c }) contains metadata item 922 i, aforward pointer 923 i, and timestamp range data 924 i. Forward pointer923 a, 923 b point to 921 b, 921 c respectively; forward pointer 923 cat the end of the chain can be set to a null pointer or some otherindication of end-of-chain. Pointer 911 a is a pointer in the associatedkey-value entry's value field, similar to 711 v described above.

At some time, a determination is made that metadata object 921 a isobsolete, and a housekeeping task is set to dissociate metadata object921 a from the associated key-value entry and from the other metadataobjects from the chain. As used in this description, “dissociation” of ametadata object from its key-value entry refers to any operation orcombination of operations that results in metadata object beingunreachable from the key-value entry.

In a first dissociation method, FIG. 9B shows the key-value entrypointer 911 a being changed to pointer value 911 b which points tometadata object 921 b. Although metadata object 921 a is still present,it is now unreachable from the key-value entry, and has thus beendissociated from the key-value entry. Since metadata object 921 a isunreachable (sometimes denoted as orphaned, and shown by dashedoutline), it can be deleted during a garbage collection operation,leaving the key-value entry and metadata object chain in the state shownin FIG. 9C. In this method, dissociation is performed by a singlepointer modification in the key-value entry.

FIGS. 9D-9F depict a second dissociation method. FIG. 9D represents thesame starting configuration as FIG. 9A. FIG. 9E shows metadata object921 a having been overwritten with the contents of metadata object 921b. The new copy of metadata object 921 b is in the same location as theearlier metadata object 921 a, and is properly pointed to by pointer 911a. Further, the new copy of metadata object 921 b contains pointer 923 bwhich properly points to metadata object 921 c. Thus, the overwritingoperation leaves the chain of metadata objects intact, from key-valueentry to object 921 b to object 921 c. Since the original metadataobject 921 a has been overwritten, it cannot be reached from thekey-value entry and has been dissociated from the key-value entry. Theoriginal copy of metadata object 921 b is now orphaned and unreachable,and can be deleted during a garbage collection operation, leaving thekey-value entry and the metadata object chain in the state shown in FIG.9F. In this method, dissociation is performed without modification ofthe key-value entry.

Example Metadata Update

FIG. 10 is a flowchart 1000 of a method for updating metadata accordingto disclosed technologies. Flowchart 1000 is divided into swim lanesindicating actions occurring at a master node and two slave nodes of adatabase environment, the slave nodes being denoted as Slave_1 andSlave_2. These nodes can be roles relative to a particularapplication-level table of the database environment; in examples,different nodes of a database environment can be masters for differentapplication-level database tables.

At process block 1012, the Slave_2 node issues a request 1001 forupdating a particular metadata item. The Master node receives therequest 1001 and updates the metadata item at process block 1015. Themetadata item update is associated with a last-update timestamp A which,in examples, can originate from the Slave_2 node, from the Master node,or from another node at which a transaction or other event led to therequest 1001. At process block 1025, the last-update timestamp A ispushed as a push notification to at least those nodes having copies ofthe updated metadata item. The push notification is received at bothSlave_1 and Slave_2 nodes, which store the last-update timestamp A atprocess blocks 1031 and 1032 respectively.

Subsequently, at process block 1041, a request 1002 for the samemetadata item is received at the Slave_1 node, the request havingtimestamp B. At process block 1051, request timestamp B is compared withlast-update timestamp A. If B≥A, then the Y branch is followed, andupdated metadata is requested from the Master node at process block1061. At process block 1075, the Master node receives the request andresponds with a copy of the updated metadata item. In some examples, thecopy of the updated metadata item is provided from the Master node tothe Slave_1 node in a transmission format, while in other examples, theupdated item is provided in a metadata object format used on the Slave_1node, and in further examples, the updated item is provided in theformat used within the master metadata table in which the master item isstored. At process block 1081, the copy of the updated metadata item isreceived and incorporated into an updated metadata object, which can beintegrated into the metadata key-value store on Slave_1. At processblock 1091, the copy of the updated metadata item is used to respond tothe metadata item request 1002.

Alternatively, if B<A is determined at process block 1051, then nometadata update is required, and the N branch is followed directly toprocess block 1091. A metadata object already present on the Slave_1node is used to respond to the metadata item request 1002.

Additional Features 1. Metadata Examples

The disclosed technologies are applicable to a wide range of metadata.Metadata items can pertain to any sort of application-level databasetable in the master database environment including, for example, columnstore tables, row store tables, alert tables, application-specifictables, application tables, BIMC tables, cluster tables, convertertables, cubes, data sources, data targets, decision tables, dictionarymapping tables, dimensional tables, disk tables, extended tables,extraction result tables, fact tables, flexible tables, hybrid tables,link tables, logical tables, in-memory tables, measurement tables,monitored tables, partitioned tables, persisted tables, pivot tables,pooled tables, remote tables, repository tables, runtime tables, seriesdata tables, system tables, temporary tables, translation tables, and/orvirtual tables.

Additionally, metadata items can describe attributes of, or otherwisesupport, other entities of the master node database instance. Storedmetadata can pertain to any of: ABAP dictionaries, applicationdescriptors, application programming interface (API) procedures,definitions of local or remote data sources, dependencies betweensoftware objects, files, folders, key figures, locks, software objectversions, packages, plugins, procedures, privileges, queues,repositories, schemas, sequences, services, synonyms, text objects,translation functions, users, versions, or views. Particularly, ametadata item can include one or more elements each describing a usertable, a table partition, a table replica, or a database view.

A view can be a result of a stored application-level query on a databaseinstance, representing combinations and subcombinations of parts of oneor more application-level database tables. A view can be implemented asread-only or as updatable. A view can have virtual or non-virtual(sometimes dubbed “materialized”) implementation.

2. Read-Only Cache

Portions of the key-value store described herein (especially metadataobjects) can be implemented as a read-only cache, which facilitateslightweight, fast, and efficient operation of the slave metadata store.Different read-only variants are within the scope of disclosedtechnologies. In all variants, there is no possibility of writeconflict, which simplifies the store implementation.

In some examples, a read-only object is one that can be created anddeleted but cannot be modified. Key-value entries can have such aread-only property. Once created, there is no need to modify a key-valueentry. Changes to metadata object versions, including deletion ofobsolete versions or updates to add new metadata object versions, can beperformed entirely by operations on the metadata objects (as opposed tochanging items inside a metadata object). Key-value entries can also bedeleted when the item to which the metadata item pertains (such as anapplication-level database table or view) is removed from the slavedatabase instance.

In other examples, a read-only object is one that offers a read-onlyclient interface, but can be written or modified by a sole owner, whichcan be the master node acting through a metadata manager on the slavenode. Key-value structures can have such a read-only property. Newentries can be added under control of the metadata manager, or existingentries can be updated (e.g., to add a metadata object version or prunean old metadata object version) under control of the metadata manager,but client-initiated operations can only search for matches in akey-value structure.

3. References

References are used in numerous places in this disclosure to point,link, or provide a path to a metadata object. For example, the valuefield of a key-value entry can contain a reference to another key-valuestructure, or to a metadata object, or to a sequential list of metadataobjects. One metadata object in a list can contain a reference toanother succeeding or preceding metadata object in the list. In someexamples, a reference can be a pointer, which is a memory address of adestination (e.g., at which a metadata object is stored). The addresscan be a physical address, or a logical address which is mapped to aphysical address through a memory management system at the slave node.Aside from pointers, references can be disk locations, file names, tableentry points, row numbers, or index values.

4. Sequential Data Structure

As described herein, multi-version concurrency control of metadata canbe supported by chaining metadata object versions having differentranges of timestamp validity in a sequential data structure such as alinked list. A sequential data structure allows at least forwardtraversal through a succession of metadata objects, and is sometimesdubbed a “chain.” In a linked list, metadata objects contain at least aforward link to a next metadata object, and can therefore be scatteredthroughout available memory. Other sequential data structures can beused, for example, a vector or a contiguous table. In a vector orcontiguous table, metadata objects of fixed size can be used, and noforward pointer is required; the next metadata object is the nextcomponent of the vector, or the next row of the contiguous table. Otherhybrid structures combining some properties or advantages of linkedlists and vectors can also be used.

A Generalized Computer Environment

FIG. 11 illustrates a generalized example of a suitable computing system1100 in which described examples, techniques, and technologies,including construction, deployment, operation, and maintenance of amaster-slave database system with lightweight replication of metadata,can be implemented. The computing system 1100 is not intended to suggestany limitation as to scope of use or functionality of the presentdisclosure, as the innovations can be implemented in diversegeneral-purpose or special-purpose computing systems.

With reference to FIG. 11, computing environment 1110 includes one ormore processing units 1122 and memory 1124. In FIG. 11, this basicconfiguration 1120 is included within a dashed line. Processing unit1122 executes computer-executable instructions, such as for implementingany of the methods or objects described herein for building a slavekey-value store, for retrieving metadata from the store, for updatingthe store, for providing multi-version concurrency, or for pruningobsolete metadata versions, or various other architectures, components,handlers, managers, modules, and repositories described herein.Processing unit 1122 can be a general-purpose central processing unit(CPU), a processor in an application-specific integrated circuit (ASIC),or any other type of processor. In a multi-processing system, multipleprocessing units execute computer-executable instructions to increaseprocessing power. Computing environment 1110 can also include a graphicsprocessing unit or co-processing unit 1130. Tangible memory 1124 can bevolatile memory (e.g., registers, cache, or RAM), non-volatile memory(e.g., ROM, EEPROM, or flash memory), or some combination thereof,accessible by processing units 1122, 1130. The memory 1124 storessoftware 1180 implementing one or more innovations described herein, inthe form of computer-executable instructions suitable for execution bythe processing unit(s) 1122, 1130. The memory 1124 can also store slavekey-value store (102), including key-value structures (130, 140, 150,710) and metadata objects (161-169, 171-178, 721 a-721 c, 722 a, 729a-729 b, 921 a-921 c), as well as other configuration and operationaldata.

A computing system 1110 can have additional features, such as one ormore of storage 1140, input devices 1150, output devices 1160, orcommunication ports 1170. An interconnection mechanism (not shown) suchas a bus, controller, or network interconnects the components of thecomputing environment 1110. Typically, operating system software (notshown) provides an operating environment for other software executing inthe computing environment 1110, and coordinates activities of thecomponents of the computing environment 1110.

The tangible storage 1140 can be removable or non-removable, andincludes magnetic disks, magnetic tapes or cassettes, CD-ROMs, DVDs, orany other medium which can be used to store information in anon-transitory way and which can be accessed within the computingenvironment 1110. The storage 1140 stores instructions of the software1180 (including instructions and/or data) implementing one or moreinnovations described herein.

The input device(s) 1150 can be a mechanical, touch-sensing, orproximity-sensing input device such as a keyboard, mouse, pen,touchscreen, trackball, a voice input device, a scanning device, oranother device that provides input to the computing environment 1110.The output device(s) 1160 can be a display, printer, speaker, opticaldisk writer, or another device that provides output from the computingenvironment 1110.

The communication port(s) 1170 enable communication over a communicationmedium to another computing device. The communication medium conveysinformation such as computer-executable instructions, requests formetadata items, copies of metadata items, or other data in a modulateddata signal. A modulated data signal is a signal that has one or more ofits characteristics set or changed in such a manner as to encodeinformation in the signal. By way of example, and not limitation,communication media can use an electrical, optical, RF, acoustic, orother carrier.

In some examples, computer system 1100 can also include a computingcloud 1190 in which instructions implementing all or a portion of thedisclosed technology are executed. Any combination of memory 1124,storage 1140, and computing cloud 1190 can be used to store softwareinstructions and data of the disclosed technologies.

The present innovations can be described in the general context ofcomputer-executable instructions, such as those included in programmodules, being executed in a computing system on a target real orvirtual processor. Generally, program modules or components includeroutines, programs, libraries, software objects, classes, components,data structures, etc. that perform particular tasks or implementparticular abstract data types. The functionality of the program modulescan be combined or split between program modules as desired in variousembodiments. Computer-executable instructions for program modules can beexecuted within a local or distributed computing system.

The terms “system,” “environment,” and “device” are used interchangeablyherein. Unless the context clearly indicates otherwise, none of theseterms implies any limitation on a type of computing system, computingenvironment, or computing device. In general, a computing system,computing environment, or computing device can be local or distributed,and can include any combination of special-purpose hardware and/orgeneral-purpose hardware and/or virtualized hardware, together withsoftware implementing the functionality described herein. Virtualprocessors, virtual hardware, and virtualized devices are ultimatelyembodied in one or another form of physical computer hardware.

An Example Cloud Computing Environment

FIG. 12 depicts an example cloud computing environment 1200 in which thedescribed technologies can be implemented. The cloud computingenvironment 1200 comprises a computing cloud 1290 containing resourcesand providing services. The computing cloud 1290 can comprise varioustypes of cloud computing resources, such as computer servers, datastorage repositories, networking resources, and so forth. The computingcloud 1290 can be centrally located (e.g., provided by a data center ofa business or organization) or distributed (e.g., provided by variouscomputing resources located at different locations, such as differentdata centers and/or located in different cities or countries).

The computing cloud 1290 can be operatively connected to various typesof computing devices (e.g., client computing devices), such as computingdevices 1212, 1214, and 1216, and can provide a range of computingservices thereto. One or more of computing devices 1212, 1214, and 1216can be computers (e.g., server, virtual machine, embedded systems,desktop, or laptop computers), mobile devices (e.g., tablet computers,smartphones, or wearable appliances), or other types of computingdevices. Connections between computing cloud 1290 and computing devices1212, 1214, and 1216 can be over wired, wireless, or optical links, orany combination thereof, and can be short-lived or long-lasting. Theseconnections can be stationary or can move over time, being implementedover varying paths and having varying attachment points at each end.Computing devices 1212, 1214, and 1216 can also be connected to eachother.

Computing devices 1212, 1214, and 1216 can utilize the computing cloud1290 to obtain computing services and perform computing operations(e.g., data processing, data storage, and the like). Particularly,software 1280 for performing the described innovative technologies canbe resident or executed in the computing cloud 1290, in computingdevices 1212, 1214, and 1216, or in a distributed combination of cloudand computing devices.

General Considerations

As used in this disclosure, the singular forms “a,” “an,” and “the”include the plural forms unless the context clearly dictates otherwise.Additionally, the terms “includes” and “incorporates” mean “comprises.”Further, the terms “coupled” or “attached” encompass mechanical,electrical, magnetic, optical, as well as other practical ways ofcoupling or linking items together, and does not exclude the presence ofintermediate elements between the coupled items. Furthermore, as usedherein, the term “and/or” means any one item or combination of items inthe phrase.

Although the operations of some of the disclosed methods are describedin a particular, sequential order for convenient presentation, it shouldbe understood that this manner of description encompasses rearrangement,unless a particular ordering is required by specific language set forthbelow. For example, operations described sequentially can in some casesbe rearranged or performed concurrently. Moreover, for the sake ofsimplicity, the attached figures may not show the various ways in whichthe disclosed things and methods can be used in conjunction with otherthings and methods. Additionally, the description sometimes uses termslike “access,” “determine,” “extract,” “find,” “get,” “process,” “read,”“respond,” “update,” and “use” to indicate computer operations in acomputer system. These terms denote actual operations that are performedby a computer. The actual operations that correspond to these terms willvary depending on the particular implementation and are readilydiscernible by one of ordinary skill in the art.

Theories of operation, scientific principles, or other theoreticaldescriptions presented herein in reference to the apparatus or methodsof this disclosure have been provided for the purposes of betterunderstanding and are not intended to be limiting in scope. Theapparatus and methods in the appended claims are not limited to thoseapparatus and methods that function in the manner described by suchtheories of operation.

Any of the disclosed methods can be implemented as computer-executableinstructions or a computer program product stored on one or morecomputer-readable storage media, such as tangible, non-transitorycomputer-readable storage media, and executed on a computing device(e.g., any available computing device, including tablets, smartphones,or other mobile devices that include computing hardware). Tangiblecomputer-readable storage media are any available tangible media thatcan be accessed within a computing environment (e.g., one or moreoptical media discs such as DVD or CD, volatile memory components (suchas DRAM or SRAM), or nonvolatile memory components (such as flash memoryor hard drives)). By way of example, and with reference to FIG. 11,computer-readable storage media include memory 1124, and storage 1140.The term computer-readable storage media does not include signals andcarrier waves. In addition, the term computer-readable storage mediadoes not include communication ports (e.g., 1170) or communicationmedia.

Any of the computer-executable instructions for implementing thedisclosed techniques as well as any data created and used duringimplementation of the disclosed embodiments can be stored on one or morecomputer-readable storage media. The computer-executable instructionscan be part of, for example, a dedicated software application or asoftware application that is accessed or downloaded via a web browser orother software application (such as a remote computing application).Such software can be executed, for example, on a single local computer(e.g., any suitable commercially available computer) or in a networkenvironment (e.g., via the Internet, a wide-area network, a local-areanetwork, a client-server network, a cloud computing network, or othersuch network) using one or more network computers.

For clarity, only certain selected aspects of the software-basedimplementations are described. Other details that are well known in theart are omitted. For example, it should be understood that the disclosedtechnology is not limited to any specific computer language or program.For instance, the disclosed technology can be implemented by softwarewritten in ABAP, Adobe Flash, C, C++, C#, Curl, Dart, Fortran, Java,JavaScript, Julia, Lisp, Matlab, Octave, Perl, Python, R, Ruby, SAS,SPSS, SQL, WebAssembly, any derivatives thereof, or any other suitableprogramming language, or, in some examples, markup languages such asHTML or XML, or in any combination of suitable languages, libraries, andpackages. Likewise, the disclosed technology is not limited to anyparticular computer or type of hardware. Certain details of suitablecomputers and hardware are well known and need not be set forth indetail in this disclosure.

Furthermore, any of the software-based embodiments (comprising, forexample, computer-executable instructions for causing a computer toperform any of the disclosed methods) can be uploaded, downloaded, orremotely accessed through a suitable communication means. Such suitablecommunication means include, for example, the Internet, the World WideWeb, an intranet, software applications, cable (including fiber opticcable), magnetic communications, electromagnetic communications(including RF, microwave, infrared, and optical communications),electronic communications, or other such communication means.

The disclosed methods, apparatus, and systems should not be construed aslimiting in any way. Instead, the present disclosure is directed towardall novel and nonobvious features and aspects of the various disclosedembodiments, alone and in various combinations and subcombinations withone another. The disclosed methods, apparatus, and systems are notlimited to any specific aspect or feature or combination thereof, nor dothe disclosed embodiments require that any one or more specificadvantages be present or problems be solved. The technologies from anyexample can be combined with the technologies described in any one ormore of the other examples.

In view of the many possible embodiments to which the principles of thedisclosed invention may be applied, it should be recognized that theillustrated embodiments are only preferred examples of the invention andshould not be taken as limiting the scope of the invention. Rather, thescope of the invention is defined by the following claims. We thereforeclaim as our invention all that comes within the scope and spirit ofthese claims.

1-15. (canceled)
 16. A computer-implemented method comprising, at aslave node in a database environment: receiving a request for a metadataitem stored in a given metadata database table, among one or moremetadata database tables at a master node in the database environment;based at least in part on the request, determining a metadata itemsearch value; looking up the metadata item search value in a key-valuestructure for the given metadata database table to find a givenkey-value entry, the given key-value entry comprising: a key; and avalue for a metadata object, wherein the metadata object includes a copyof the metadata item stored in the given metadata database table; andusing the given key-value entry to get the copy of the metadata item.17. The method of claim 16, wherein: the request includes a timestamp;in the given key-value entry, the value references a sequential datastructure that includes: a first version of the metadata object, thefirst version providing a first snapshot of the metadata item stored inthe given metadata database table; and a second version of the metadataobject, the second version providing a second snapshot of the metadataitem stored in the given metadata database table, wherein the secondsnapshot is later than the first snapshot; and the using the givenkey-value entry to get the copy of the metadata item comprises:comparing the timestamp of the request to timestamp range data for thefirst version and/or to timestamp range data for the second version; andidentifying the second version of the metadata object as containing therequested metadata item.
 18. The method of claim 16, further comprising:based at least in part on the request, determining a structure searchvalue; and looking up the structure search value in a parent key-valuestructure to find a parent key-value entry, the parent key-value entrycomprising: a key that is an identifier for the given metadata databasetable; and a value that is a reference to the key-value structure forthe given metadata database table.
 19. The method of claim 16, whereinthe metadata item stored in the given metadata database table is one ormore elements each describing part of a feature of a user databasetable.
 20. (canceled)
 21. The method of claim 16, wherein the key of thegiven key-value entry matches the metadata item search value.
 22. Themethod of claim 16, wherein the request is a second request following afirst request for the requested metadata item, the method furthercomprising, responsive to the first request: determining that thekey-value structure for the given metadata database table lacks amatching key-value entry; retrieving a copy of the requested data itemfrom the master node; constructing the key-value entry; and adding thekey-value entry to the key-value structure for the given metadatadatabase table.
 23. The method of claim 16, wherein the looking up isperformed by serial traversal or by binary search.
 24. The method ofclaim 16, wherein the key-value structure is a hash table, and thelooking up is performed by computing a hash of the metadata item searchvalue.
 25. The method of claim 16, further comprising, subsequent to theusing: determining that the metadata object is obsolete; anddissociating the metadata object from the given key-value entry.
 26. Themethod of claim 16, wherein the given key-value entry is read-only. 27.The method of claim 16, wherein the given key-value entry is accessiblethrough a read-only client interface, and can be written or modified byan owner of the key-value entry.
 28. One or more computer-readable mediahaving stored therein computer-executable instructions which, whenexecuted by one or more hardware processors at a slave node in adatabase environment, cause the one or more hardware processors toperform operations comprising: receiving a request for a metadata itemstored in a given metadata database table, among one or more metadatadatabase tables at a master node in the database environment; based atleast in part on the request, determining a metadata item search value;looking up the metadata item search value in a key-value structure forthe given metadata database table to find a given key-value entry, thegiven key-value entry comprising: a key; and a value for a metadataobject, wherein the metadata object includes a copy of the metadata itemstored in the given metadata database table; and using the givenkey-value entry to get the copy of the metadata item.
 29. The one ormore computer-readable media of claim 28, wherein the request is a firstrequest, the copy of the metadata item is a first copy of the metadataitem, and the operations further comprise: receiving a second requestfor the requested metadata item; responsive to the second request,obtaining a second copy of the metadata item from the given key-valueentry; wherein the first and second copies of the metadata item aredistinct, based on distinct respective transaction timestamps of thefirst and second requests.
 30. The one or more computer-readable mediaof claim 29, wherein the metadata object comprises a valid timestamprange bracketing the transaction timestamp of the first request.
 31. Theone or more computer-readable media of claim 28, wherein the value ofthe given key-value entry points to a head of a sequential datastructure having a newer copy of the metadata item stored closer to thehead than an older copy of the metadata item.
 32. The one or morecomputer-readable media of claim 28, wherein, in the given key-valueentry, the value is a reference to the metadata object.
 33. The one ormore computer-readable media of claim 28, wherein, in the givenkey-value entry, the value is the metadata object.
 34. The one or morecomputer-readable media of claim 28, wherein, in the given key-valueentry, the value is a placeholder.
 35. A computer system comprising: oneor more hardware processors; and memory coupled to the one or morehardware processors; wherein the computer system is configured toperform operations of a slave node in a database environment, theoperations comprising: receiving a request for a metadata item stored ina given metadata database table, among one or more metadata databasetables at a master node in the database environment; based at least inpart on the request, determining a metadata item search value; lookingup the metadata item search value in a key-value structure for the givenmetadata database table to find a given key-value entry, the givenkey-value entry comprising: a key; and a value for a metadata object,wherein the metadata object includes a copy of the metadata item storedin the given metadata database table; and using the given key-valueentry to get the copy of the metadata item.
 36. The computer system ofclaim 35, wherein the given metadata database table at the master nodesupports guaranteed database transactions, and wherein the key-valuestructure at the slave node supports non-guaranteed operations.